package com.wuhainan.beelzebub.service.system;

import com.wuhainan.beelzebub.entity.system.AppData;
import com.wuhainan.beelzebub.utils.Constant;
import com.wuhainan.beelzebub.utils.tree.TreeParser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <br>Created by 吴海南 on 2017-12-18.
 * <br>星期一 at 下午 3:05.
 */

@Service
public class AppDataService {

    @Resource
    private AppService appService;
    @Resource
    private UserService userService;
    @Resource
    private MenuService menuService;

    public AppData appData() {
        AppData appData = new AppData();
        appData.setUser(userService.findOne("1"));
        appData.setApp(appService.findOne("1"));
        appData.setMenu(TreeParser.getTreeList(Constant.topId,menuService.findAll()));
        return appData;
    }

}
